package com.atguigu.spzx.service.exception;

import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.Data;

/**
 * ClassName: GuliException
 * Package: com.atguigu.spzx.service.exception
 * Description:
 *
 * @Author 刘强
 * @Create 2024/6/29 13:11
 * @Version 1.0
 */

@Data
public class GuliException extends RuntimeException{
    public Integer code;
    private String message;
    private ResultCodeEnum resultCodeEnum;

    public GuliException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public GuliException(ResultCodeEnum resultCodeEnum) {
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
        this.resultCodeEnum = resultCodeEnum;
    }

}
